package com.nine.pattern.factory.static_;

import com.nine.pattern.factory.simple.Coffee;

/**
 * @author nine
 * @version 1.0
 * @description 直接调用静态工厂方法
 * @date 2024-06-27 22:16
 */
public class CoffeeStore {

	public Coffee orderCoffee(String type) {
		// SimpleCoffeeFactory simpleCoffeeFactory = new SimpleCoffeeFactory();
		// 简单工厂模式，根据类型创建对象
		// Coffee coffee = simpleCoffeeFactory.createCoffee(type);

		Coffee coffee = SimpleCoffeeFactory.createCoffee(type);

		// 添加配料
		coffee.addMilk();
		coffee.addSugar();

		return coffee;
	}

}
